
Page({
  data: {
    items: '',
    money: ''
  },

  addItem: function () {

    wx.navigateTo({
      url: '../NewAccounts/NewAccounts'

    })
  },
  onShow: function () {
    let tableID = 37774
    let Product = new wx.BaaS.TableObject(tableID)
    Product.find().then(res => {
      this.setData({
        money: res.data.objects[res.data.objects.length - 1].remain
      })
    }, err => {
      wx.showModal({
        title: '当前数据库为空！',
      })
    })
    let tableID1 = 38225
    let Product1 = new wx.BaaS.TableObject(tableID1)
    Product1.orderBy('-rechargedate').find().then(res => {
      this.setData({
       items: res.data.objects
      })
    }, err => {
      wx.showModal({
        title: '当前数据库为空！',
      })
    })
  }


})
